<title>商圈管理</title>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-btn-group layui-card-header">
            <button class="layui-btn layui-btn-primary layui-btn-sm" lay-href="mall/store/add">新增商圈</button>
        </div>
        <table class="layui-hide" id="business"></table>
    </div>    
</div>

<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>    
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
               
<script>
    layui.use(['table'], function(){
        var $ = layui.$,
            setter  = layui.setter,
            request = setter.request,
            table = layui.table;
        let options = request.init(
        {
            elem: '#business'
            ,url: setter.host + 'shop/business-circle'
            ,cellMinWidth: 80
            ,height: 'full-200'
            ,page: true
            ,limit:30
            ,cols: [[
                {type: 'checkbox'},
                {field:'id', title: 'ID', sort: true}
                ,{field:'name', title: '名称', align: 'center'} //width 支持：数字、百分比和不填写。你还可以通过 minWidth 参数局部定义当前单元格的最小宽度，layui 2.2.1 新增
                ,{field:'country', title: '国家'}
                ,{field:'prov', title: '省份'}
                ,{field:'city', title: '城市'}
                ,{field:'area', title: '县区'}
                ,{field:'town', title: '城镇'}
                ,{field:'desc', title: '描述'}                
                ,{'title':'操作', toolbar:'#barDemo'}
            ]]
        });

        table.render(options);
    });   

</script>
